.so ../bk-macros
.TH "bk upgrade" "\*[BKVER]" %E% "\*(BC" "\*(UM"
.SH NAME
bk upgrade \- upgrade to, or check for, new versions of BitKeeper
.SH SYNOPSIS
.B bk upgrade
.[B] \-cdfq
.[OPTopt] \-a arch
.[ARG] srcurl
.SH DESCRIPTION
.LP
The
.B bk upgrade
command contacts \*[BM]'s servers using HTTP to see if new versions
of \*[BK] are available for download.  If a new version is found
for this platform, then the image is downloaded and installed,
unless instructed otherwise with the options below.
.SH OPTIONS
.TP "\-a [\*<arch\*>] "
.OPTopt \-a arch
Requests an installer image for another architecture and reports the newest
available version.
Usually used with
.Q \-d
to download a \*[BK] installer for another platform.
If
.Q \-d
is not set then 
.Q \-c
is implied.
Omit the architecture to request a list of all supported platforms.
.tp
.B \-c
Just check to see if a new version \*[BK] is available for this platform
but do not download and install it.
.tp
.B \-d
Download the installer for a new version of \*[BK], but do not
install it.
.tp
.B \-f
If the
.B bk upgrade
command is unable to determine if the currently installed version of
\*[BK] has been replaced by a newly released version, then an
warning message is printed and the upgrade is aborted.  The
.Q \-f
option allow the user to force the new version to be used.
.tp
.B \-q
This causes the upgrade program to suppress extra output when running.
.SH EXAMPLES
To check for new upgrades:
.DS
bk upgrade -c
.DE
To install a new version of bk:
.DS
bk upgrade
.DE
To upgrade a given installation of bk on this machine:
.DS
/home/user/bitkeeper/bk upgrade
.DE
To download the latest installer regardless of what you have installed:
.DS
bk upgrade -df
.DE
To download the latest installer for Windows:
.DS
bk upgrade -df -ax86-win32
.DE
.SH NOTES
The default URL that \*[BK] uses to search for new updates can be
overridden with the
.Q upgrade_url
config option.  This will usually be
used in a corporate environment to prevent users from using a new
version of \*[BK] that has not been certified locally. Usually an
internal URL will be put in a config file in the \*[BK] install
directory.
.LP
To populate the local copy of the binaries you will need to 
.B wget 
the directory of binaries from bitkeeper.com; the images
are encrypted and 
.B bk upgrade
expects that and will not work with un-encrypted images.
.LP
To download the images run
.DS
wget -r http://upgrades.bitkeeper.com/upgrades
.DE
.SH EXIT STATUS
.TP
0
if a new version of \*[BK] is found
.tp
1
if no updates are available
.tp
2
if errors occurred downloading new updates
.SH "SEE ALSO"
.SA config-etc
.SH CATEGORY
.B Utility
